{include file="public/header" /}
<style type="text/css">
    #des, #des input {
        width: 40px;
        text-align: center;
    }

    #id {
        width: 78px;
    }

    .bs-checkbox {
        width: 36px;
        height: 40px
    }

    .fixed-table-toolbar .columns, .fixed-table-toolbar .search {
        margin-left: 0px;
        margin-top: 0px
    }

    #title span {
        float: right;
    }

    .btn-active {
        background: #1ab394;
        color: #fff
    }
</style>
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="ibox float-e-margins">
        {include file="public/tophead"}
        {include file="public/top" /}
        <div class="ibox-content">
            <div class="row row-lg">

                <div style="display:block;clear: both;"></div>
                <div class="fixed-table-toolbar">
                    <form method="get" action="">
                        <div class="pull-left search">

                            <div class="columns columns-right btn-group pull-left">
                                <select class="form-control" name="search_field">
                                    <option value="b.money" {if input('get.search_field') eq 'b.money'}selected="selected"{/if}>总奖金</option>
                                    <option value="b.netincome" {if input('get.search_field') eq 'b.netincomee'}selected="selected"{/if}>总净奖金</option>
                                    <option value="b.recommend_money" {if input('get.search_field') eq 'b.recommend_money'}selected="selected"{/if}>推荐奖</option>
                                    <option value="b.commission_money" {if input('get.search_field') eq 'b.commission_money'}selected="selected"{/if}>佣金奖</option>

                                </select>
                            </div>

                            <div class="columns columns-right btn-group pull-left">
                                <select class="form-control" name="search_op">
                                    <option value="gt" >大于</option>
                                    <option value="eq" >等于</option>
                                    <option value="lt" >小于</option>
                                </select>
                            </div>

                            <div class="columns columns-right btn-group pull-left">
                                <input class="form-control input-outline" placeholder="金额" type="search_value" name="search_value" value="{:input('get.search_value', '')}" />
                            </div>

                            <div class="columns columns-right btn-group pull-left">
                                <select class="form-control" name="field">
                                    <option value="m.id"  {if input('get.field') eq 'm.id'}selected="selected"{/if} >用户id</option>
                                    <option value="m.username"  {if input('get.field') eq 'm.username'}selected="selected"{/if} >手机号</option>
                                    <option value="m.nickname"  {if input('get.field') eq 'm.nickname'}selected="selected"{/if}>昵称</option>
                                    <option value="b.periods" {if input('get.field') eq 'b.periods'}selected="selected"{/if}>期数</option>
                                </select>
                            </div>
                            <div class="columns columns-right btn-group pull-left">
                                <input class="form-control input-outline" placeholder="" type="text" name="value" value="{:input('get.value', '')}" />
                            </div>

                            <div class="pull-right search">
                                <button style="border-radius:0px; border:1px solid #e5e6e7; border-left:0px"
                                        class="btn btn-default btn-outline" type="submit">搜索
                                </button>
                                {if input('?get.back')}
                                <input  type="hidden" name="back" value="-1"/>
                                <a class="btn btn-w-m btn-link" href="{:url('bonus/source')}">返回</a>
                                {/if}
                            </div>


                            <div class="columns columns-right btn-group pull-right">
                                <input type="text" name="date_range" id="date_range" class="form-control" placeholder="结算时间"
                                       value="{if !empty($name.begin_date)}{$name.begin_date}{/if}{if !empty($name.end_date)} - {$name.end_date}{/if}" />
                            </div>

                        </div>
                    </form>

                </div>
                <div class="example">
                    <form class="form-horizontal" method="post">
                        <table data-toggle="table">
                            <thead>
                            <tr>

                                <th data-align="center">期数</th>
                                <th data-align="center">会员id</th>
                                <th data-align="center">会员昵称</th>
                                <th data-align="center">手机号</th>
                                <th data-align="center">总奖金收入</th>
                                <th data-align="center">总净奖金收入</th>
                                <th data-align="center">推荐奖</th>
                                <th data-align="center">佣金奖</th>
                                <th data-align="center">合伙人奖</th>
                                <th data-align="center">是否发放</th>
                                <th data-align="center">发放方式</th>
                                <!--<th data-align="center">状态</th>-->
                                <th data-align="center">奖金结算时间</th>
                                <th data-align="center">奖金发放时间</th>
                                <th data-align="center">来源</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="list" id="vo"}
                            <tr id="id{$vo.id}">
                                <td>{$vo.periods}</td>
                                <td>{$vo.member_id}</td>
                                <td>{$vo.nickname}</td>
                                <td>{$vo.username}</td>
                                <td>{$vo.money}</td>
                                <td>{$vo.netincome}</td>
                                <td>{$vo.recommend_money}</td>
                                <td>{$vo.commission_money}</td>
                                <td>{$vo.partner_money}</td>
                                <td>{if $vo.done}已发{else}未发{/if}</td>
                             <td>{$grant_types[$vo.grant_type]}</td>
                                <!--<td>{if $vo.state==0}正常{else}停发{/if}</td>-->
                                <td>{if $vo.create_time}{$vo.create_time|date='Y-m-d H:i:s'}{/if}</td>
                                <td>{if $vo.grant_time}{$vo.grant_time|date='Y-m-d H:i:s'}{/if}</td>
                                <td>
                                    <span class="btn btn-xs btn-primary" onclick="layer.alert('{$vo.source}',{title:'奖金来源'})">来源</span>
                                </td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                    </form>
                </div>
            </div>

            <hr>
            <div class="row row-lg">
                <div class="col-sm-12 pages">{$page|raw}</div>
            </div>
        </div>
    </div>
</div>

{include file="public/footer" /}
{load href="__STYLE__/admin/plugins/bootstrap/bootstrap-table.min.css"}
{load href="__STYLE__/admin/plugins/bootstrap/bootstrap-table.min.js"}
{load href="__STYLE__/admin/plugins/bootstrap/bootstrap-table-zh-CN.min.js"}
<script type="text/javascript">
    function openSource(content) {
        layer.alert('Hi，你好！ 点击确认更换图标', {
            icon: icon,
            shadeClose: true,
            title: icon === -1 ? '初体验 - layer '+layer.v : 'icon：'+icon + ' - layer '+layer.v
        }, changeIcon);
    }
    //年月范围
    layui.use('laydate',function () {
        layui.laydate.render({
            elem: '#date_range',
            type: 'date',
            range: true
        });
    });
</script>